package com.lvcoding.common;

import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;

/**
 * @author wuyanshen
 * jwt令牌注入userDetailsService，这样通过SecurityContextHolder.getContext().getAuthentication().getPrincipal()获得的就不只是名字了
 */
public class OauthJwtAccessTokenConverter extends JwtAccessTokenConverter {

    public OauthJwtAccessTokenConverter(UserDetailsService userDetailsService) {
        super.setAccessTokenConverter(new OauthAccessTokenConverter(userDetailsService));
    }
}
